// File Name: ProviderFragmentCustom.h

#ifndef	PROVIDERFRAGMENTCUSTOM_H
#define	PROVIDERFRAGMENTCUSTOM_H

#include <UIAutomationCore.h>

namespace UIAutomationCPP
{
	public class ProviderFragmentCustom : public IRawElementProviderFragment
	{
		public:
			ProviderFragmentCustom();
			~ProviderFragmentCustom();

			HRESULT __stdcall GetEmbeddedFragmentRoots(SAFEARRAY** pRetVal);
			HRESULT __stdcall GetRuntimeId(SAFEARRAY** pRetVal);
			HRESULT __stdcall Navigate(NavigateDirection direction, IRawElementProviderFragment** pRetVal);
			HRESULT __stdcall SetFocus();

			HRESULT __stdcall get_BoundingRectangle(UiaRect* pRetVal);
			HRESULT __stdcall get_FragmentRoot(IRawElementProviderFragmentRoot** pRetVal);

			HRESULT __stdcall QueryInterface(REFIID riid, void **ppvObj);
			ULONG __stdcall AddRef();
			ULONG __stdcall Release();

		private:
			int itemIndex;
			int AppendRuntimeId;
			ULONG refCount;

			IRawElementProviderFragment* parentProvider;
			IRawElementProviderFragment* nextSiblingProvider;
			IRawElementProviderFragment* previousSiblingProvider;
	};
}
#endif
